//
//  HLLiveHeaderUserCell.m
//  YueYue
//
//  Created by hulu001 on 2024/3/12.
//

#import "HLLiveHeaderUserCell.h"

@interface HLLiveHeaderUserCell ()

@property (nonatomic, strong) UIImageView *iconView;

@end

@implementation HLLiveHeaderUserCell


-(instancetype)initWithFrame:(CGRect)frame{
    
    if ([super initWithFrame:frame]) {
        self.backgroundColor = UIColorClear;
        [self setupView];
    }
    return self;
    
}

- (void)setupView {
    self.iconView = [[UIImageView alloc] init];
    _iconView.userInteractionEnabled = NO;
    _iconView.layer.masksToBounds = YES;
    _iconView.layer.cornerRadius = 13;
    _iconView.contentMode = UIViewContentModeScaleAspectFill;
    _iconView.backgroundColor = UIColorRed;
    [self.contentView addSubview:_iconView];
    [_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

- (void)setUser:(HLLiveUserModel *)user
{
    [_iconView sd_setImageWithURL:[NSURL URLWithString:user.userAvatar] placeholderImage:[HLUIHelper avatarPlaceholder]];
}

@end
